package org.example.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.example.system.common.base.BaseEntity;

/**
 * 支付记录表
 * @TableName biz_trade_record
 */
@EqualsAndHashCode(callSuper = true)
@TableName(value ="biz_trade_record")
@Accessors(chain = true)
@Data
public class BizTradeRecord extends BaseEntity implements Serializable {
    /**
     * 交易ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 订单ID(外键)
     */
    @TableField(value = "order_id")
    private Integer orderId;

    /**
     * openid
     */
    @TableField(value = "open_id")
    private String openid;

    /**
     * 承租人ID(外键)
     */
    @TableField(value = "tenant_id")
    private Integer tenantId;

    /**
     * 车辆ID(外键)
     */
    @TableField(value = "vehicle_id")
    private Integer vehicleId;

    /**
     * 商户订单号
     */
    @TableField(value = "out_trade_no")
    private String outTradeNo;

    /**
     * 微信支付订单号
     */
    @TableField(value = "transaction_id")
    private String transactionId;

    /**
     * 支付金额，单位：分
     */
    @TableField(value = "total_fee")
    private BigDecimal totalFee;

    /**
     * 支付时间
     */
    @TableField(value = "payment_time")
    private LocalDateTime paymentTime;

    /**
     * 支付方式 0:微信支付 1：支付宝等
     */
    @TableField(value = "payment_type")
    private Integer paymentType;

    /**
     * 交易状态 0：未支付 1：已支付
     */
    @TableField(value = "trade_status")
    private Integer tradeStatus;

//    /**
//     * 创建时间
//     */
//    @TableField(value = "create_time")
//    private LocalDateTime createTime;
//
//    /**
//     * 更新时间
//     */
//    @TableField(value = "update_time")
//    private LocalDateTime updateTime;

    /**
     * 逻辑删除 0：未删除 1：已删除
     */
    @TableField(value = "deleted")
    private Integer deleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}